/*
 * @Author: zhao.dp
 * @Date: 2022-08-31 14:18:50
 * @LastEditors: zhao.dp
 * @LastEditTime: 2022-08-31 16:01:19
 * @Description:
 */
import fs from 'fs'

export function getFolder(path) {
  const components = new Set()
  components.add(path)
  const files = fs.readdirSync(path)
  files.forEach((item) => {
    let stat = fs.lstatSync(path + '/' + item)
    if (stat.isDirectory() === true && item != 'components') {
      components.add(path + '/' + item)
      components.add.apply(components, getFolder(path + '/' + item))
    }
  })
  return Array.from(components)
}
